<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <script src="/webjars/jquery/3.3.1/jquery.min.js"></script>
    <script src="/webjars/Semantic-UI/2.4.1/semantic.js"></script>
    <script src="/js/main.js"></script>
    <link href="/webjars/Semantic-UI/2.4.1/semantic.css" rel="stylesheet">
    <link href="/css/main.css" rel="stylesheet">
    <title>Редактирование коментария</title>
</head>
<body>
    <div th:insert="~{menu :: menu}"></div>
    <div class="ui container">
        <h1 class="ui header">Редактирование коментария</h1>
        <form class="ui form" action="/comments/update" method="post">
            <input th:value="${comment.id}" type="hidden" name="id">
            <div class="field">
                <label>Текст комментария</label>
                <input th:value="${comment.text}" class="txtInput" type="text" name="text" placeholder="Напишите комментарий">
            </div>
            <div class="field">
                <label>Книги</label>
                <select class="ui fluid search dropdown bookDropdown" name="book_id">
                    <option value="">Выберите книгу</option>
                    <option th:each="book : ${books}"
                            th:value="${book.id}"
                            th:text="${book.name}"
                            th:selected="${book.id==comment.book.id}">
                        Название книги
                    </option>
                </select>
            </div>
            <button class="ui submit button" type="submit"><i class="ui check icon"></i>Сохранить</button>
        </form>
    </div>
</body>
</html>